package java_exceptions;

public class practice3 {
	static int divide(int x, int y) {
		if (y == 0) {
			throw new ArithmeticException
			    ("denominator can not be 0");
		} else {
			return x / y;
		}
	}
	public static void main(String[] args) {
		try {
			System.out.println(divide(10, 2));
			System.out.println(divide(10, 0));
		} catch (ArithmeticException e) {
			System.out.println(e.toString());
		}
	}
}
